<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #aa{
            background-color: blue;
        }
        .red{
            background-color: red !important;
            color: white;
        }
    </style>
    <script src="../jquery.min.js"></script>
</head>
<body>
    <div id="aa">
        这是一个测试代码
    </div>
    <script>
        $("#aa").on("click",function(){
            $("#aa").toggleClass("red");
        })
    </script>
</body>
</html>